package com.yoomiito.app.utils;

import android.os.Parcel;
import android.os.Parcelable;

public class EventMessage implements Parcelable {
    private String mEventType;//事件类型
    private int code;//识别码
    private int mGoodsType;//商品类型  一般前两个就可以
    private String msg;
    private String goodsID;//仅用于订单支付

    public String getGoodsID() {
        return goodsID;
    }

    public void setGoodsID(String goodsID) {
        this.goodsID = goodsID;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public int getGoodsType() {
        return mGoodsType;
    }

    public void setGoodsType(int goodsType) {
        mGoodsType = goodsType;
    }

    public String getEventType() {
        return mEventType;
    }

    public void setEventType(String eventType) {
        mEventType = eventType;
    }

    @Override
    public String toString() {
        return "EventMessage{" +
                "mEventType='" + mEventType + '\'' +
                ", code=" + code +
                ", mGoodsType=" + mGoodsType +
                ", msg='" + msg + '\'' +
                '}';
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.mEventType);
        dest.writeInt(this.code);
        dest.writeInt(this.mGoodsType);
        dest.writeString(this.msg);
        dest.writeString(this.goodsID);
    }

    public EventMessage() {
    }

    protected EventMessage(Parcel in) {
        this.mEventType = in.readString();
        this.code = in.readInt();
        this.mGoodsType = in.readInt();
        this.msg = in.readString();
        this.goodsID=in.readString();
    }

    public static final Parcelable.Creator<EventMessage> CREATOR = new Parcelable.Creator<EventMessage>() {
        @Override
        public EventMessage createFromParcel(Parcel source) {
            return new EventMessage(source);
        }

        @Override
        public EventMessage[] newArray(int size) {
            return new EventMessage[size];
        }
    };
}
